import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class ShowToast extends StatefulWidget {

  const ShowToast({Key? key}) : super(key: key);

  @override
  _ShowToastState createState() => _ShowToastState();

  void MyToast(String msg) {
    print(msg);
    try {

      Fluttertoast.showToast(
          msg: msg,
          toastLength: Toast.LENGTH_SHORT,
          gravity: ToastGravity.CENTER,
          timeInSecForIosWeb: 1,
          backgroundColor: Colors.black38,
          textColor: Colors.white,
          fontSize: 12);
    } catch (e) {
      print(e);
    }
  }
}

class _ShowToastState extends State<ShowToast> {

  @override
  void initState() {
    // TODO: implement initState
    super.initState();

  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}
